//引入当前文件对应的less文件
require("../less/advertisement.less")

//2
document.ready(function () {
    //获取元素
    const skioNum = document.querySelector('#skioNum');
    const skipBtn = document.querySelector("#skipBtn");
    
    let num = 5;
    skioNum.textContent = num;//修改页面

    //倒计时跳转
   let timerId= window.setInterval(function () {
        num -= 1;
        skioNum.textContent = num;
        if(num===0){
            //清除定时器
            window.clearInterval(timerId);
            //跳转
            window.location.href = "./register.html";
        }
    }, 1000)

    //跳过的点击事件
    spikBtn.addEventListener("click",function(){
        window.clearInterval(timerId);
            //跳转
            window.location.href = "./register.html";
    })
})